<template>
    <div class="subpage supply-success-container">
        <div class="supply-success-top">
            <img src="@/assets/img/home_img30.png" alt="">
            <p>供货成功</p>
            <p>供货总重量：{{totalWeight}}kg</p>
            <p>单价：{{salesPrice}}{{salesPriceUnit}}</p>
        </div>
        <div class="supply-success-bottom">
            <van-button round class="u-btn-default" to="/">返回首页</van-button>
            <van-button round class="u-btn-default" @click="jumpOrder">查看订单</van-button>
        </div>
        <div class="hint-info">
            <p>温馨提示</p>
            <p>
                <span>1、</span>
                <span>供货发布成功后，求货方支付成功会以短信方式通知您。</span>
            </p>
            <p>
                <span>2、</span>
                <span>供货资金会以收到短信日起T+1个工作日转入账户余额，节假日顺延。</span>
            </p>
        </div>
    </div>
</template>

<script>
export default {
    data() {
        return {
            totalWeight: '',
            salesPrice: '',
            salesPriceUnit: ''
        }
    },
    created() {
        this.totalWeight = this.$route.query.totalWeight;
        this.salesPrice = this.$route.query.salesPrice;
        this.salesPriceUnit = decodeURI(this.$route.query.salesPriceUnit);
    },
    methods: {
        jumpOrder() {
            this.$router.push({
                path: '/my/supplyOrder/supplyOrderDetail/' + this.$route.query.orderId,
            })
        }
    }
}
</script>

<style lang="scss" scoped>
    .supply-success-container {
        width: 100%;
        padding: 60px 0 0;
        box-sizing: border-box;
        background-color: #fff;
        .supply-success-top {
            padding: 0 49px;
            box-sizing: border-box;
            text-align: center;
            img {
                width: 120px;
                height: 95px;
                object-fit: cover;
            }
            p:nth-of-type(1) {
                margin-top: 24px;
                font-size: 20px;
                font-weight: 500;
            }
            p:nth-of-type(2) {
                margin-top: 12px;
                font-size: 16px;
                color: #5D6164;
            }
            p:nth-of-type(3) {
                margin-top: 6px;
                color: #969C9E;
            }
        }
        .supply-success-bottom {
            width: 100%;
            margin-top: 20px;
            padding: 0 49px;
            box-sizing: border-box;
            display: flex;
            justify-content: space-between;
            align-items: center;
            button {
                width: 120px;
                height: 32px;
                line-height: 32px;
                box-shadow: none;
                border: 1px solid #31BC8D;
                color: #31BC8D;
                font-size: 16px;
            }
        }
        .hint-info {
            width: 100%;
            margin-top: 34px;
            padding: 0 24px;
            box-sizing: border-box;
            p {
                margin-bottom: 10px;
                display: flex;
                color: #969C9E;
                &:first-child {
                    margin-bottom: 16px;
                }
            }
        }
    }
</style>